<!DOCTYPE html>
<html lang="zh">
<head>
    <title>{block name="title"}{$title|default=''}{if !empty($title)} · {/if}{:sysconf('site_name')}{/block}</title>
    <meta charset="utf-8">
    <meta name="renderer" content="webkit">
    <meta name="format-detection" content="telephone=no">
    <meta name="apple-mobile-web-app-capable" content="yes">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="apple-mobile-web-app-status-bar-style" content="black">
    <meta name="viewport" content="width=device-width,initial-scale=1,maximum-scale=2">
    <link rel="shortcut icon" href="{:sysconf('site_icon')}">
    <link rel="stylesheet" href="__ROOT__/static/plugs/layui/css/layui.css?at={:date('md')}">
    <link rel="stylesheet" href="__ROOT__/static/theme/css/iconfont.css?at={:date('md')}">
    <link rel="stylesheet" href="__ROOT__/static/theme/css/console.css?at={:date('md')}">
    {block name="style"}{/block}
    <script>window.tapiRoot = '{:sysuri("admin/index/index",[],false)}'</script>
    <script src="__ROOT__/static/plugs/jquery/pace.min.js"></script>
    <script src="__ROOT__/static/plugs/layui/layui.js"></script>
    <script src="__ROOT__/static/plugs/require/require.js"></script>
    <script src="__ROOT__/static/admin.js"></script>
</head>

{block name='content'}

<form action="{:request()->url()}" autocomplete="off" class="layui-form layui-card" data-auto="true" method="post">
    <div class="layui-card-body padding-40">

        <label class="layui-form-item relative block">
            <span class="color-green font-w7">ID</span>
            <span class="color-desc margin-left-5">ID</span>
            <input class="layui-input" name="id" value='{$vo.id|default=""}' readonly>
        </label>

        <label class="layui-form-item relative block">
            <span class="color-green font-w7">城市负责人</span>
            <span class="color-desc margin-left-5">name_city</span>
            <input class="layui-input" value='{$vo.name_city}' readonly>
        </label>

        <label class="layui-form-item relative block">
            <span class="color-green font-w7">对接日期</span>
            <span class="color-desc margin-left-5">time_docking</span>
            <input class="layui-input" name="time_docking" data-date-input placeholder="请输入对接日期" value='{$vo.time_docking|format_date}'>
        </label>

        <div class="layui-row layui-col-space15">
            <span class="color-green font-w7 label-required-prev">所在区域</span>
            <span class="color-desc margin-left-5">（原区域：{$vo.province|default='--'} - {$vo.city|default=''} - {$vo.area|default=''} ）</span>
            <div class="layui-row layui-col-space10">
                <label class="layui-col-xs4"><select class="layui-select" lay-filter="province" name="province"></select></label>
                <label class="layui-col-xs4"><select class="layui-select" lay-filter="city" name="city"></select></label>
                <label class="layui-col-xs4"><select class="layui-select" lay-filter="area" name="area"></select></label>
            </div>
        </div>

        <div class="layui-col-xs12 relative block">
            <span class="color-green font-w7 label-required-prev">归属城市</span>
            <span class="color-desc margin-left-5">（原区域：{$vo.province_owner|default='--'} - {$vo.city_owner|default=''} ）</span>
            <div class="layui-row layui-col-space10">
                <label class="layui-col-xs4"><select class="layui-select" lay-filter="province_owner" name="province_owner"></select></label>
                <label class="layui-col-xs4"><select class="layui-select" lay-filter="city_owner" name="city_owner"></select></label>
            </div>
        </div>

        <label class="layui-form-item relative block">
            <span class="color-green font-w7">司机</span>
            <span class="color-desc margin-left-5">username</span>
            <input class="layui-input" name="username" value='{$vo.username|default=""}'>
        </label>

        <label class="layui-form-item relative block">
            <span class="color-green font-w7">车牌</span>
            <span class="color-desc margin-left-5">plate_number</span>
            <input class="layui-input" name="plate_number" value='{$vo.plate_number|default=""}'>
        </label>

        <label class="layui-form-item relative block">
            <span class="color-green font-w7">电话</span>
            <span class="color-desc margin-left-5">phone</span>
            <input class="layui-input" name="phone" value='{$vo.phone|default=""}'>
        </label>

        <label class="layui-form-item relative block">
            <span class="color-green font-w7">车型</span>
            <span class="color-desc margin-left-5">car_vehicle_type</span>
            <input class="layui-input" name="car_vehicle_type" value='{$vo.car_vehicle_type|default=""}'>
        </label>

        <div class="goods-item-box">
            <div class="layui-clear">
                <fieldset>
                    <legend><span class="layui-badge think-bg-violet">喷漆完成</span></legend>
                    <div class="layui-form-item">
                        {foreach [-1 => '其他', 1 => '是',0 => '否'] as $k=>$v}
                        {if (isset($vo.paint_status) and $vo.paint_status eq $k) or (empty($vo.paint_status) and $k eq 1)}
                        <input checked name="paint_status" title="{$v}" type="radio" value="{$k}">
                        {else}
                        <input name="paint_status" title="{$v}" type="radio" value="{$k}">
                        {/if}
                        {/foreach}
                    </div>
                </fieldset>
            </div>
        </div>

        <label class="layui-form-item relative block">
            <span class="color-green font-w7">车身颜色</span>
            <span class="color-desc margin-left-5">car_color</span>
            <input class="layui-input" name="car_color" value='{$vo.car_color|default=""}'>
        </label>

        <label class="layui-form-item relative block">
            <span class="color-green font-w7">首次邀约情况</span>
            <span class="color-desc margin-left-5">InviteRemark</span>
            <textarea class="layui-textarea" name="invite_remark" placeholder="请输入首次邀约情况">{$vo.invite_remark|default=''}</textarea>
        </label>

        <label class="layui-form-item relative block">
            <span class="color-green font-w7">首次邀约日期</span>
            <span class="color-desc margin-left-5">time_invite</span>
            <input class="layui-input" name="time_invite" data-date-input placeholder="请输入首次邀约日期" value='{$vo.time_invite|format_date}'>
        </label>

        <label class="layui-form-item relative block">
            <span class="color-green font-w7">最近邀约情况</span>
            <span class="color-desc margin-left-5">InviteRemark</span>
            <textarea class="layui-textarea" name="invite_remarks" placeholder="请输入最近邀约情况">{$vo.invite_remarks|default=''}</textarea>
        </label>

        <label class="layui-form-item relative block">
            <span class="color-green font-w7">最近邀约日期</span>
            <span class="color-desc margin-left-5">InviteRemark</span>
            <textarea class="layui-textarea" name="time_invites" placeholder="请输入最近邀约日期">{$vo.time_invites|default=''}</textarea>
        </label>

        <label class="layui-form-item relative block">
            <span class="color-green font-w7">喷漆师傅</span>
            <span class="color-desc margin-left-5">painter</span>
            <input class="layui-input" name="painter" value='{$vo.painter|default=""}'>
        </label>

        <div class="goods-item-box">
            <div class="layui-clear">
                <fieldset>
                    <legend><span class="layui-badge think-bg-violet">尾部喷漆</span></legend>
                    <div class="layui-form-item">
                        {foreach [-1 => '其他', 1 => '是',0 => '否'] as $k=>$v}
                        {if (isset($vo.end_paint_status) and $vo.end_paint_status eq $k) or (empty($vo.end_paint_status) and $k eq 1)}
                        <input checked name="end_paint_status" title="{$v}" type="radio" value="{$k}">
                        {else}
                        <input name="end_paint_status" title="{$v}" type="radio" value="{$k}">
                        {/if}
                        {/foreach}
                    </div>
                </fieldset>
            </div>
        </div>

        <div class="goods-item-box">
            <div class="layui-clear">
                <fieldset>
                    <legend><span class="layui-badge think-bg-violet">是否有覆盖</span></legend>
                    <div class="layui-form-item">
                        {foreach [-1 => '其他', 1 => '是',0 => '否'] as $k=>$v}
                        {if (isset($vo.has_cover) and $vo.has_cover eq $k) or (empty($vo.has_cover) and $k eq 1)}
                        <input checked name="has_cover" title="{$v}" type="radio" value="{$k}">
                        {else}
                        <input name="has_cover" title="{$v}" type="radio" value="{$k}">
                        {/if}
                        {/foreach}
                    </div>
                </fieldset>
            </div>
        </div>

        <div class="goods-item-box">
            <div class="layui-clear">
                <fieldset>
                    <legend><span class="layui-badge think-bg-violet">广告覆盖是否收费</span></legend>
                    <div class="layui-form-item">
                        {foreach [-1 => '其他', 1 => '是',0 => '否'] as $k=>$v}
                        {if (isset($vo.ad_cover_fee) and $vo.ad_cover_fee eq $k) or (empty($vo.ad_cover_fee) and $k eq 1)}
                        <input checked name="ad_cover_fee" title="{$v}" type="radio" value="{$k}">
                        {else}
                        <input name="ad_cover_fee" title="{$v}" type="radio" value="{$k}">
                        {/if}
                        {/foreach}
                    </div>
                </fieldset>
            </div>
        </div>

        <label class="layui-form-item relative block">
            <span class="color-green font-w7">覆盖几面</span>
            <span class="color-desc margin-left-5">cover_num</span>
            <input class="layui-input" name="cover_num" value='{$vo.cover_num|default=""}' type="number" step="1" min="1">
        </label>

        <div class="hr-line-dashed"></div>
        {notempty name='vo.id'}<input name='id' type='hidden' value='{$vo.id}'>{/notempty}

<!--        <div class="layui-form-item text-center">-->
<!--            <button class="layui-btn" type="submit">保存数据</button>-->
<!--            <button class="layui-btn layui-btn-danger" data-confirm="确定要取消编辑吗？" data-history-back type='button'>取消编辑</button>-->
<!--        </div>-->
    </div>

</form>

{/block}
{block name='script'}

<script>
    /*! 表单初始化 */
    window.form.render();

    /*! 表单初始化 */
    require(['pcasunzips'], function () {
        (function (prov, city, area, refresh) {
            new PCAS("province", "city", "area", prov, city, area);
            refresh(), form.on('select(province)', refresh), form.on('select(city)', refresh), form.on('select(area)', refresh);
        })("{$vo.province}", "{$vo.city}", "{$vo.area}", function (data) {
            (data && $(data.elem).trigger('change')), setTimeout(function () {
                layui.form.render();
            }, 100);
        });
    });

    require(['pcasunzips'], function () {
        (function (prov, city, area, refresh) {
            new PCAS("province_owner", "city_owner", prov, city);
            refresh(), form.on('select(province_owner)', refresh), form.on('select(city_owner)', refresh), form.on('select(area)', refresh);
        })('{$vo.province_owner|default=""}', '{$vo.city_owner|default=""}', '', function (data) {
            (data && $(data.elem).trigger('change')), setTimeout(function () {
                layui.form.render();
            }, 100);
        });
    });

</script>
{/block}
